| Conditions | 1 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' |
||
| 10 | /** |
||
| 11 | * Handle request |
||
| 12 | */ |
||
| 13 | public async handle({ auth }: HttpContextContract, next: () => Promise<void>) { |
||
| 14 | /** |
||
| 15 | * Check if user is logged-in or not. If yes, then `ctx.auth.user` will be |
||
| 16 | * set to the instance of the currently logged in user. |
||
| 17 | */ |
||
| 18 | await auth.check() |
||
| 19 | await next() |
||
| 20 | } |
||
| 22 |